﻿using System;
using System.ServiceModel;
using Ayatta.Contract.Component;
using Ayatta.Contract.Domain;
using System.Collections.Generic;

namespace Ayatta.Contract
{
    [ServiceContract(Namespace = ServiceContract.Namespace)]
    public interface IBaseService : IService
    {
        //#region Location

        //[OperationContract]
        //IList<Location> GetLocations();

        //#endregion

        #region Area

        [OperationContract]
        IList<Area> GetAreas();

        #endregion

        #region Logistics.Company

        [OperationContract]
        IList<LogisticsCompany> GetLogisticsCompanies();

        #endregion

        #region FAQ

        [OperationContract]
        bool CreateFaq(Faq o);

        [OperationContract]
        bool UpdateFaq(Faq o);

        [OperationContract]
        bool DeleteFaq(int id);

        [OperationContract]
        Faq GetFaq(int id);

        [OperationContract]
        PagedList<Faq> GetPagedFaqs(int index = 1, int size = 20, string title = null,
                                   byte? category = null, bool? showOnMenu = null);

        #endregion

        #region EmailAccount

        [OperationContract]
        bool CreateEmailAccount(EmailAccount o);

        [OperationContract]
        bool UpdateEmailAccount(EmailAccount o);

        [OperationContract]
        bool DeleteEmailAccount(int id);

        [OperationContract]
        EmailAccount GetEmailAccount(int id);

        [OperationContract]
        IList<EmailAccount> GetAllEmailAccount();

        [OperationContract]
        PagedList<EmailAccount> GetPagedEmailAccount(int index = 1, int size = 20);

        #endregion

        #region EmailTemplate

        [OperationContract]
        bool CreateEmailTemplate(EmailTemplate o);

        [OperationContract]
        bool UpdateEmailTemplate(EmailTemplate o);

        [OperationContract]
        bool DeleteEmailTemplate(int id);

        [OperationContract]
        EmailTemplate GetEmailTemplate(int id);

        [OperationContract]
        IList<EmailTemplate> GetAllEmailTemplate();

        [OperationContract]
        PagedList<EmailTemplate> GetPagedEmailTemplate(int index = 1, int size = 20);

        #endregion

        #region Slide
        [OperationContract]
        bool CreateSlideCategory(SlideCategory o);

        [OperationContract]
        bool UpdateSlideCategory(SlideCategory o);

        [OperationContract]
        SlideCategory GetSlideCategory(int id);

        [OperationContract]
        IList<SlideCategory> GetSlideCategories();

        /// <summary>
        /// 获取所有可用幻灯片分类 包含可用幻灯片
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        IList<SlideCategory> GetAvailableSlideCategories();

        /// <summary>
        /// 获取所有幻灯片分类
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        PagedList<SlideCategory> GetPagedSlideCategories(int index = 1, int size = 20, string title = null,
                                                        int? category = null, bool? status = null);
        [OperationContract]
        bool CreateSlide(Slide o);

        [OperationContract]
        bool UpdateSlide(Slide o);

        [OperationContract]
        bool DeleteSlide(int id);

        [OperationContract]
        Slide GetSlide(int id, bool includeCategory = false);

        /// <summary>
        /// 获取幻灯片分类下的所有幻灯片
        /// </summary>
        /// <param name="index">当前页</param>
        /// <param name="size">分页大小</param>
        /// <param name="categoryId">幻灯片分类Id</param>
        /// <param name="title">标题</param>
        /// <param name="status">状态</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns></returns>
        [OperationContract]
        PagedList<Slide> GetPagedSlides(int index = 1, int size = 20, int categoryId = 0, string title = null, bool? status = null, DateTime? startTime = null, DateTime? endTime = null);

        #endregion

    }
}